/***
 * IT COMMON
 * Common javascript functions
 */
function get(id) { return document.getElementById(id); }

function setStyleAttr(id,p,v) { 
	var e = document.getElementById(id);
	if(e != null) { 
		e.style[p] = v;
	 } 
}

/**
 * Makes a page element be visible
 */
function show(id) { 
	var e = document.getElementById(id);
	if (e != null) { 
		if(arguments.length>1) { 
			setStyleAttr(id,"display",arguments[1]); 
		} else { 
			setStyleAttr(id,'display','block'); 
		} 
	} 
}

/**
 * Makes a page element be invisible
 */
function hide(id) { 
	var e = document.getElementById(id); 
	if (e != null) { 
		if(arguments.length>1) { 
			setStyleAttr(id,"display",arguments[1]); 
		} else { 
			setStyleAttr(id,'display','none'); 
		} 
	} 
}

/**
 * Removes commas, spaces in preparation
 * for peristing currency values
 */
function cleanCurrency(value) {
	value = value.replace(/,/g, "");
	value = value.replace(/ /g, "");
	return value;
}